package com.ww.common.exception;

import com.ww.common.dtos.AppHttpCodeEnum;
import lombok.Getter;

/**
 * 自定义业务异常类
 *   404: 服务资源找不到
 *   400： 参数类型错误或不匹配
 *   401： 权限不足
 *   500： 服务器错误
 */
@Getter
public class LeadNewsException extends RuntimeException{
    private Integer status;//业务状态码
    public LeadNewsException(Integer status,String message){
        super(message);
        this.status = status;
    }

    public LeadNewsException(AppHttpCodeEnum appHttpCodeEnum){
        super(appHttpCodeEnum.getErrorMessage());
        this.status = appHttpCodeEnum.getCode();
    }
}